{% extends "layout" %}

{% block local %}<div id="local">
<p>You can find there a list of every installed kits. Icons meaning below :</p>
<p class="kit_ok">This kit seems functional.</p>
<p class="kit_ko">This kit meets some problem. See details on its page</p>
<p class="has_tests">This kit provide unit tests.</p>
<p class="has_subkits">This kit includes subkits.</p>
<p class="link">This kit has its web site.</p>
</div>
</div>{% endblock %}

{% block main %}
	{% comment %}<pre>{{ kits|vardump }}</pre>{% endcomment %}

	<table class="kits" summary="installed kits">
		<caption>Installed Kits</caption>
		<tr class="headers">
			<th>Diagnostics</th>
			<th>Id</th>
			<th>Description</th>
			<th class="tests"><span>Has unit tests ?</span></th>
			<th class="doc"><span>Has documentation ?</span></th>
			<th class="subkits"><span>Has subkits ?</span></th>
		</tr>{% for kit in kits %}
		<tr class="{% cycle odd,even %}">
			{% if kit.error %}
			<td class="icon kit_ko"><span>ko</span></td>
			{% else %}
			<td class="icon kit_ok"><span>ok</span></td>
			{% endif %}

			<td><a href="kit/{{ forloop.key }}">{{ kit.id }}</a></td>
			<td>{{ kit.desc }}</td>

			{% if kit.has_tests %}
				<td class="icon has_tests"><span>yes</span></td>
			{% else %}
				<td class="icon has_no_tests"><span>no</span></td>
			{% endif %}

			<td></td>

			{% if kit.subkits %}
				<td class="has_subkits"><span>{{ kit.subkits|count }}</span></td>
			{% else %}
				<td class="has_no_subkits"><span>0</span></td>
			{% endif %}

			{% if kit.link %}
				<td class="link"><a href="{{ kit.link }}">web</a></td>
			{% else %}
				<td class="link"></td>
			{% endif %}

		</tr>{% endfor %}
	</table>

	{% comment %}<ul class="kits">{% for cfg in kits %}
		<li>
			<a href="kit/{{ forloop.key }}">{{ forloop.key }}</a>
			{{ cfg.kit.version }}
			{{ cfg.kit.desc }}
			{% if cfg.kit.link %}<a href="{{ cfg.kit.link }}">web site</a>{% endif %}
		</li>{% endfor %}
	</ul>{% comment %}
{% endblock %}
